<?php
/**
 * Created by PhpStorm.
 * User: change
 * Date: 2016/12/23
 * Time: 20:20
 * 医生职称
 */

namespace Admin\Model;


use Base\Model\BaseModel;

class PositioninfoModel extends BaseModel
{
    protected $_validate = array(
        array('name', 'require', '名称必须填写'),
        array('name', '', '职称已存在', 0, 'unique', 3),
        array('name','/^[a-zA-Z_\x{4e00}-\x{9fa5}]+$/u', '职称名称不符合规则！',3),
    );
    protected $_link = array(
        //包含子科室
        'positioninfo' => array(
            'mapping_type' => self::BELONGS_TO,
            'foreign_key' => 'id',
            'parent_key' => 'pid',
            'mapping_order' => 'id',
        )
    );
    protected $_auto = array(
        array('status', '1'),
    );
}